package com.rocsea.robot.builder;
import com.rocsea.robot.model.bo.KettleProduct;
import com.rocsea.robot.model.request.KettleBuildRequest;
/**
 * @Author RocSea
 * @Date 2023/1/31
 */
public class KettleBuildRobot {
    private KettleBuilder kettleBuilder;

    public KettleBuildRobot(KettleBuilder kettleBuilder) {
        this.kettleBuilder = kettleBuilder;
    }

    public KettleProduct makeProduct(KettleBuildRequest request) throws Exception {
        kettleBuilder.init(request);
        kettleBuilder.buildResource();
        kettleBuilder.buildTransformation();
        kettleBuilder.buildJob();
        kettleBuilder.buildKettleTaskConfig();
        kettleBuilder.buildKettlePack();
        return kettleBuilder.build();
    }

}
